﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using dtu_lan_winRT_app.Model.Users;

namespace dtu_lan_winRT_app.Model.Tournament
{
    public class Tournament
    {
        public Game Game { get; set; }
        public List<Team> Teams { get; set; }
        public List<Participant> Participants { get { return listParticipants(); } }

        public Tournament()
        {
        }

        private List<Participant> listParticipants()
        {
            List<Participant> participants = new List<Participant>();
            foreach (Team t in Teams)
            {
                foreach (Participant p in t.Members) participants.Add(p);
            }
            //Might need to return null if there are no participants
            return participants;
        }


    }


    public class Game
    {
        public Game()
        {
        }
    }

    public class Team
    {
        public int Size { get; set; }
        public List<Participant> Members { get; set; }

        public Team(int size)
        {
            this.Size = size;
        }

        public Team(int size, List<Participant> members) : this(size)
        {
            this.Members = members;
        }
    }
}
